#include "designerbridgew.h"
#include "formeditorw.h"
#include "widgetboxw.h"

QString DesignerBridgeW::pluginFailureString() const
{
    return FormEditorW::instance()->pluginFailureString();
}

void DesignerBridgeW::setPluginPath(const QString &pluginPath)
{
   FormEditorW::instance()->setPluginPath(pluginPath);
}

DesignerBridgeW::DesignerBridgeW(QWidget *parent) : QWidget(parent), m_initialized(false)
{
}

bool DesignerBridgeW::initializeJambiPlugins(const QString &jambiBase, const QString &jambiPluginPath, const QString &customWidgetClassPath, const QString &resourcePath, const QString &jvm)
{
    return FormEditorW::instance()->initializeJambiPlugins(jambiBase, jambiPluginPath, customWidgetClassPath, resourcePath, jvm);
}

void DesignerBridgeW::initialize()
{
    if (!m_initialized)
    {
        m_initialized = true;
        FormEditorW::instance()->initialize();
    }
}

void DesignerBridgeW::updateCustomWidgetLocation(const QString &path)
{
    WidgetBoxW *w = WidgetBoxW::instance();

    if (w != 0)
    {
        w->updateCustomWidgetLocation(path);
    }
}

